feat(sandbox): add BoxLite VM runtime backend for hardware-level isolation#423
Closed
DorianZheng wants to merge 1 commit intoNVIDIA:mainfrom
Closed
feat(sandbox): add BoxLite VM runtime backend for hardware-level isolation#423DorianZheng wants to merge 1 commit intoNVIDIA:mainfrom
DorianZheng wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
…ation Add BoxLite as an optional sandbox runtime backend alongside the existing Linux kernel isolation (Landlock + seccomp + netns). When enabled, the agent runs inside a hardware-isolated lightweight VM instead of relying on kernel primitives. Architecture: - New `runtime` module with `RuntimeKind` enum dispatch (Process | Boxlite) - `SandboxedProcess` enum wraps either ProcessHandle or BoxliteProcess - `ProcessBackend` wraps existing ProcessHandle::spawn unchanged - `BoxliteBackend` talks to BoxLite REST API via HTTP (no native dep conflicts) - Feature-gated behind `boxlite` Cargo feature (zero impact on default builds) Key changes: - `run_sandbox()` gains `runtime_kind` parameter for backend selection - Network namespace creation skipped when backend provides own isolation - CLI: `--runtime boxlite` or `OPENSHELL_RUNTIME=boxlite` env var - `ProcessStatus::from_code()` constructor for BoxLite exit code mapping Closes NVIDIA#421
|
Thank you for your interest in contributing to OpenShell, @DorianZheng. This project uses a vouch system for first-time contributors. Before submitting a pull request, you need to be vouched by a maintainer. To get vouched:
See CONTRIBUTING.md for details. |
|
Thank you for your submission! We ask that you sign our Developer Certificate of Origin before we can accept your contribution. You can sign the DCO by adding a comment below using this text: I have read the DCO document and I hereby sign the DCO. You can retrigger this bot by commenting recheck in this Pull Request. Posted by the DCO Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds BoxLite as an optional VM-based runtime backend for OpenShell sandboxes, providing hardware-level isolation alongside the existing Linux kernel isolation (Landlock + seccomp + netns).
runtimemodule withRuntimeKindenum dispatch —Process(default, existing behavior) andBoxlite(VM-based, feature-gated)boxliteCargo featureWhat changes
Usage
Files
New:
crates/openshell-sandbox/src/runtime/mod.rs—RuntimeKind,SandboxedProcessenum,SpawnConfigcrates/openshell-sandbox/src/runtime/process_backend.rs— wraps existingProcessHandlecrates/openshell-sandbox/src/runtime/boxlite_backend.rs— REST client for BoxLite APIModified:
crates/openshell-sandbox/Cargo.toml—boxlitefeature withreqwest+serdecrates/openshell-sandbox/src/lib.rs— runtime dispatch inrun_sandbox()crates/openshell-sandbox/src/main.rs—--runtimeCLI argcrates/openshell-sandbox/src/process.rs—ProcessStatus::from_code()constructorCloses #421
Test plan
cargo check -p openshell-sandbox(no feature) — compiles unchangedcargo check -p openshell-sandbox --features boxlite— compiles with BoxLitecargo test -p openshell-sandbox --features boxlite— 302 tests passcargo fmt -p openshell-sandbox -- --check— cleanopenshell-sandbox --runtime boxlite -- echo hellowith BoxLite server running